function updateDirector(btn){
	 $('#update').fadeIn(500);
	var num = $(btn).parents("tr").find('td').length;
	for(var i=0;i<num;i++){
		var value1=	$(btn).parents("tr").find('td').eq(i).html();
		$("#update").find("input").eq(i).val(value1);
	}
	
}


function directorDefinite(btn){
	 $('#definite').fadeIn(500);
	var num1 = $(btn).parents("tr").find('td').length;
	for(var i=0;i<num1-1;i++){
		var value1=$(btn).parents("tr").find('td').eq(i).html();
		$("#definite").find("input").eq(i-1).val(value1);
	}
}
function addIn(btn){
	$("#add").fadeIn(500);
}
function updatecloseBtn(btn){

	 $('#update').fadeOut(500);
}
function addbtnclose(btn){
	 $('#add').fadeOut(500);
	
}
function definitebtnclose(btn){
	 
	 $('#definite').fadeOut(500);
}
function pageBtn(p){
	
	var page=$(p).find("a").html();
	$(p).attr("class","active data");
	window.location.href="/film/director.do?firstPage="+page;
}
function performerPageUp(pageNum){
	if(pageNum > 1){
		location.href="/film/director.do?firstPage="+(pageNum-1);
	}else{
		alert("已经是第一页了！");
	}
}
function performerPageDown(pageNum,pageSize){
	
	if(pageNum<pageSize){
		location.href="/film/director.do?firstPage="+(pageNum+1);
	}else{
		alert("已经是最后一页了！");
	}
	
}
	 

//表单验证
function checkForm(){
	var dir_name = $("#add input[name=dir_name]").val();
	var dir_foreignName = $("#add input[name=dir_foreignName]").val();
	var dir_nickName = $("#add input[name=dir_nickName]").val();
	var filmImg = $("#add input[name=filmImg]").val();
	var dir_birth = $("#add input[name=dir_birth]").val();
	var dir_height = $("#add input[name=dir_height]").val();
	var dir_sex = $("#add input[name=dir_sex]").val();
	var dir_nationality = $("#add input[name=dir_nationality]").val();
	var dir_birthPlace = $("#add input[name=dir_birthPlace]").val();
	var dir_star = $("#add input[name=dir_star]").val();
	var dir_introduce = $("#add input[name=dir_introduce]").val();
	
	if(dir_name=='' || dir_foreignName=='' || dir_nickName=='' || 
			filmImg=='' || dir_birth=='' || dir_height=='' || 
			dir_sex=='' || dir_nationality=='' || dir_birthPlace=='' || 
			dir_star=='' || dir_introduce==''){
		alert("输入的信息不能为空")
		return false;
	}else{
		return true;
	}
}